package org.yang.faq.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.yang.faq.model.Comment;
import org.yang.faq.model.Program;
import org.yang.faq.service.ProgramService;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api
@Controller
@RequestMapping("/ProgramController")
public class ProgramController {
	@Autowired
	private ProgramService programService;

	@ApiOperation(value = "节目单", notes = "获取全部节目单")
	@RequestMapping(value = "/Program", method = RequestMethod.GET)
	@ResponseBody
	public Page<Program> findAll() {
		Page<Program> page = new Page<Program>(1, 100);
		EntityWrapper wrapper = new EntityWrapper<Comment>();
		wrapper.orderBy("create_time");
		page = programService.selectPage(page, wrapper);
		return page;
	}
}
